<template>
  <div class="error-container">
    <h2 class="title">
      {{ title }}
    </h2>
    <p class="sub-title">
      {{ subTitle }}
    </p>
    <ElButton
      type="primary"
      size="small"
      @click="$router.replace('/')"
    >
      {{ $t('返回首页') }}
    </ElButton>
  </div>
</template>

<script>
export default {
  name: 'Error',
  props: {
    title: {
      type: String,
      required: true
    },
    subTitle: {
      type: String,
      required: true
    }
  }
}
</script>

<style lang="scss" scoped>
.error-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;

  .sub-title {
    margin-top: 20px;
    margin-bottom: 60px;
  }
}
</style>
